package com.example.eurekaclient.domain;

import lombok.Data;

/**
 * @author GuoAo
 * @className AjaxResult
 * @date 2025/3/5
 * @description TODO
 */
@Data
public class AjaxResult {
    private int code;
    private String msg;

    public static AjaxResult success(String msg) {
        AjaxResult ajaxResult = new AjaxResult();
        ajaxResult.setCode(200);
        ajaxResult.setMsg(msg);
        return ajaxResult;
    }

    public static AjaxResult error(String msg) {
        AjaxResult ajaxResult = new AjaxResult();
        ajaxResult.setCode(500);
        ajaxResult.setMsg(msg);
        return ajaxResult;
    }
}
